<?php


namespace App\Http\Requests\Manage\System\Dictionary\HsCode;


use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class UpdateRequest extends FormRequest
{
    /**
     * @return array
     * @author luffyzhao@vip.126.com
     */
    public function rules()
    {
        return [
            'name' => ['required', 'max:255'],
            'unit1' => ['required', 'size:3', Rule::exists('unit', 'code')],
            'unit2' => ['nullable', 'size:3', Rule::exists('unit', 'code')],
            'element' => ['required', 'max:255'],
        ];
    }
}
